package com.yuantu.judiciary.model.domain;

import com.yuantu.judiciary.model.BaseDO;
import com.yuantu.judiciary.model.enums.SmsTemplateType;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * 短信记录表
 *
 * @author syw
 * @since 2023-06-08
 **/
@Data
@Entity
@Table(name = "sms_record")
public class SmsRecordDO extends BaseDO {

    /**
     * 手机号
     */
    @Column(length = 20, nullable = false)
    @Comment("手机号")
    private String phone;

    /**
     * 内容
     */
    @Column(columnDefinition = "text")
    @Comment("内容")
    private String content;

    /**
     * 消息类型
     */
    @Enumerated(EnumType.STRING)
    @Column(nullable = false)
    @Comment("消息类型")
    private SmsTemplateType type;

    /**
     * 验证码失效时间
     */
    @Column(columnDefinition = "datetime")
    @Comment("验证码失效时间")
    private Timestamp expiresTime;

    /**
     * 备注
     */
    @Column(columnDefinition = "varchar(255) comment '备注'")
    private String remarks;
}
